package me.boot.db.mybatis.template.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.boot.common.constant.DbConst;
import me.boot.gen.table.annotation.ColumnComment;
import me.boot.gen.table.annotation.IsAutoIncrement;

@Getter
@Setter
public abstract class SnowflakeEntity extends Entity<Number> {
    /**
     * 自动生成id【雪花算法】
     */
    @IsAutoIncrement
    @ColumnComment("唯一编码")
    @ApiModelProperty("唯一编码")
    @TableId(value = DbConst.COLUMN_ID, type = IdType.ASSIGN_ID)
    protected Number id;
}
